import React from 'react';
import { inject, observer } from 'mobx-react';
import { Spin, Button, Icon, Modal } from 'antd'
import {WeaBrowser, WeaPopoverHrm, WeaSearchGroup, WeaTextarea,WeaRightMenu,WeaInput, WeaCheckbox,WeaDatePicker, WeaSelect, WeaFormItem, WeaRichText, WeaNewScroll, WeaTools, WeaUpload, WeaTop ,WeaDialog,WeaLocaleProvider} from 'ecCom';
import { toJS } from "mobx";
import CubeLayout from "../../../govern/components/E9/cubeLayout";
import * as Util from '../../util/Util';
const getLabel = WeaLocaleProvider.getLabel;
@inject('taskAddStore')
@observer
export default class TaskAdd extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            spinning: false,
            params: {
                taskName: '',//目标名称
                enddate: '',//结束时间
                remark: '',//描述
                lev: '5',//紧急程度
                principalid: [],//责任人
                parentid: [],//上级任务
                todoval: '4',//标记方式
                partnerid: [],//参与人
                taskids: [],//相关任务
                goalids: [],//相关目标
                docids: [],//相关文档
                wfids: [],//相关流程
                crmids: [],//相关客户
                projectids: [],//相关项目
                relatedacc: "",//相关附件
                relateadd: 1,//新增页面标识
                mainpage: 1,//返回值标识
                tag:"",//标签
                showallsub:"",//是否开放下级任务
            },
            sTab: [
                {key: "1",selected: false,showname: getLabel(15537,'今天')},
                {key: "2",selected: false,showname: getLabel(22488,'明天')},
                {key: "3",selected: false,showname: getLabel(382509,'即将')},
                {key: "4",selected: false,showname: getLabel(382499,'不标记')},
                {key: "5",selected: false,showname: getLabel(382498,'备忘')},
            ],
            urgent: [
                {key: "5",selected: false,showname: getLabel(15808,'未设置')},
                {key: "1",selected: false,showname: getLabel(382501,'重要紧急')},
                {key: "2",selected: false,showname: getLabel(382502,'重要不紧急')},
                {key: "3",selected: false,showname: getLabel(382503,'不重要紧急')},
                {key: "4",selected: false,showname: getLabel(382504,'不重要不紧急')},
            ],
            viewHeight: this.getHeight(),
            category: '',
            maxUploadSize: '',
            menu :[
                {
                  key: '0',
                  icon: <i className='icon-coms-Save-as' />,
                  content: getLabel(86,'保存'),
                  onClick: key => this.doNewSave(),
                }],
            collectParams :{
                favname: getLabel(15266,'新建任务'),
                favouritetype: 5,
                link: '/spa/workrelate/static/index.html#/main/workrelate/task/taskAdd',
                importantlevel: 1,
            }
        }
        this.uploading = false;
    }
    componentWillMount() {//一些初始化请求
        let requestids = Util.getParams("requestids")||'';
        WeaTools.callApi('/api/workrelate/task/getTaskFileCategory', 'GET', {requestids:requestids}).then((data) => {
            if (data.status == 1) {
                this.setState({ category: data.secId, maxUploadSize: data.maxsize,params:{...this.state.params,principalid:[{id:data.userid,name:data.username}]} });
                if(requestids!=''){
                    this.setState({params:{...this.state.params,taskName:data.wfname,wfids:data.wflist}});
                }
            }
        });
        const{taskAddStore} = this.props;
        let _this = this;
        taskAddStore.initForm({doback:function(){
            if(!taskAddStore.isloading){
                _this.setState({spinning:true});
            }
        }});
    }
    componentWillReceiveProps(newProps) {
       this.cleanValues();
       const{taskAddStore} = newProps;
       if(!taskAddStore.isloading){
        this.setState({spinning:true});
       }
       WeaTools.callApi('/api/workrelate/task/getTaskFileCategory', 'GET', {}).then((data) => {
            if (data.status == 1) {
                this.setState({ category: data.secId, maxUploadSize: data.maxsize,params:{...this.state.params,principalid:[{id:data.userid,name:data.username}]} });
            }
        });
    }
    initCallBack=()=>{
        const{params} = this.state;
        const{taskAddStore:{Card},isDialog} = this.props;
        let _fields = Card.allFields;
        for(let key  in _fields){
            let _obj = _fields[key];
            if(_obj.fieldname=="name" && !isDialog){
                window.ModeForm.changeFieldValue(key, {
                    value: params.taskName,   
                    showhtml: params.taskName
                }); 
            }
            if(_obj.fieldname=="principalid"){
                window.ModeForm.changeFieldValue(key, {
                    value: params.principalid,   
                    showhtml: params.principalid
                }); 
            }
        }
        let requestids = Util.getParams("requestids")||'';
        if(requestids!=''){
            
        }
        this.setState({spinning:false});
    }
    getHeight() {
        const {isDialog} = this.props;
        if(isDialog){
            return window.innerHeight - 110;
        }else{
            return window.innerHeight - 60;
        }
    }
    //新的保存调用方法
    doNewSave=()=>{
        const{taskAddStore} = this.props;
        let _this = this;
        taskAddStore.saveTask({doback:function(data,type,extendDatas){
            _this.doSubmit(data,type,extendDatas);
        }});
    }
    doSubmit(data,_type,extendDatas) {
        let alldatas = this.state.params;
        if(_type==1){
            alldatas = { ...alldatas,...data};
            alldatas.extendDatas = JSON.stringify(extendDatas);
            alldatas.isecme = 1;
            alldatas.taskName = data.name;
            let _alldatas = this.state.params;
            alldatas.tag = _alldatas.tag;
            alldatas.showallsub = _alldatas.showallsub;
            alldatas.parentid = _alldatas.parentid;
            //判断开始日期和结束日期大小
            let _begindate = alldatas.begindate;
            let _enddate = alldatas.enddate;
            if(_begindate!="" && _enddate!=""){
                if(Util.DateDiffDays(_begindate,_enddate)<0){
                    Modal.warning({
                        title:  getLabel(558,'提示'),
                        content: getLabel(16721,'开始日期不能大于结束日期'),
                    });
                    return;
                }
            }
            const{taskAddStore:{isMandatoryArry}} = this.props;
            if(isMandatoryArry && isMandatoryArry.length>0){
                for(let i=0;i<isMandatoryArry.length;i++){
                    if(alldatas[isMandatoryArry[i]]==""){
                        Modal.warning({
                            title:  getLabel(558,'提示'),
                            content: getLabel(509065, '请输入必填项'),
                        });
                        return;
                    }
                }
            }
        }
        let canSave = true;
        let tname = alldatas.taskName;
        if (tname.trim() == '' || tname.trim() == 'null') {//标题为空
            canSave = false;
        }
        if (!canSave) {
            Modal.warning({
                title:  getLabel(558,'提示'),
                content: getLabel(504646,'任务名称不能为空'),
            });
        } else {
            this.setState({ spinning: true });
            if (this.uploading) {
                if(_type==1){
                    this.setState({ params: alldatas });
                }
                this.refs.addtaskupload.doUpload();
            } else {
                this.saveTask(alldatas);
            }
        }
    }
    saveTask(alldatas) {
        for (let key in alldatas) {
            if (key == 'principalid' || key == 'parentid' || key == 'partnerid' || key == 'taskids' ||
                key == 'goalids' || key == 'docids' || key == 'wfids' || key == 'crmids' || key == 'projectids' || key == 'tag') {
                let str = '', arr = [];
                if(Array.isArray(alldatas[key])){
                    alldatas[key].forEach((element) => {
                        arr.push(element.id)
                    })
                    alldatas = { ...alldatas, [key]: arr.toString() }
                }
            }
        }
        if (this.props.detailKey != undefined) {
            alldatas.parentid = this.props.detailKey;
        }
        alldatas.sorttype = this.props.sorttype;
        const {isDialog} = this.props;
        WeaTools.callApi('/api/workrelate/task/addTask', 'POST', alldatas).then((data) => {
            if (data.status == 1) {
                this.cleanValues();
                let optparams = {};
                if (typeof this.props.onAddSuccess === "function") {
                    optparams.datas = data.datas;
                    optparams.opttype = "add";
                    optparams.optkey = data.taskId;
                    optparams.optdatetype = data.datetype;
                    this.props.onAddSuccess(optparams);
                } else if (typeof this.props.onDialogAddSuccess === "function") {
                    optparams.datas = data.datas;
                    optparams.optkey = data.taskId;
                    optparams.optdatetype = data.datetype;
                    if (this.props.detailKey != undefined) {
                        optparams.parentid = this.props.detailKey;
                    }
                    optparams.subdatas = data.subdatas;
                    this.props.onDialogAddSuccess(optparams);
                }
                if(!isDialog){
                    window.location = "/spa/workrelate/static/index.html#/main/workrelate/task/taskDetail?id="+data.taskId;
                } 
            } else if(data.status == 2){
                Modal.warning({
                    title: getLabel(558,'提示'),
                    content: getLabel(508760,'保存出错,您没有给已选上级任务新建下级任务的权限'),
                });
                this.uploading = false;
                this.setState({spinning:false});
            }else{
                Modal.warning({
                    title:getLabel(558,'提示'),
                    content: getLabel(508744,'保存出错,请重新尝试或联系管理员'),
                });
                this.uploading = false;
                this.setState({spinning:false});
            }
        });
    }
    cleanValues() {
        this.setState({
            spinning:false,
            params: {
                taskName: '',
                enddate: '',
                remark: '',
                lev: '5',
                principalid: [],
                parentid: [],
                todoval: '4',
                partnerid: [],
                taskids: [],
                goalids: [],
                docids: [],
                wfids: [],
                crmids: [],
                projectids: [],
                relatedacc: "",
                relateadd: 1,
                mainpage: 1,
                tag:"",
                showallsub:"",
            },
        });
        this.uploading = false;
        const {taskAddStore} = this.props;
        taskAddStore.cubeLayoutParame = {};
    }

    onChangeBrowser = (ids, names, datas, type) => {
        let { params } = this.state;
        params = { ...params, [type]: datas }
        this.setState({ params: params })
    }
    onInputChange = (values, type) => {
        let { params } = this.state;
        params = { ...params, [type]: values };
        this.setState({ params: params });
    }
    uploadChange(ids, list) {
        let { params } = this.state;
        params = { ...params, relatedacc: ids.toString() }
        this.saveTask(params);
    }
    setUploading(listB) {
        if (listB.length > 0) {
            this.uploading = true;
        } else {
            this.uploading = false;
        }
    }
    getButton = (ecId)=>{
        let buttonsCreate = [
            (<Button ecId={`${ecId}_Button@r39tj5@save`} type="primary" onClick={this.doNewSave} loading={this.state.spinning}>{getLabel(86,'保存')}</Button>),
            (<Button ecId={`${ecId}_Button@8czc36@close`} type="ghost" onClick={this.onlyClose}>{getLabel(309,'关闭')}</Button>)
        ];
        return buttonsCreate;
    }
    onlyClose=()=>{
        this.cleanValues();
        if (typeof this.props.onlyClose === "function") {
            this.props.onlyClose();
        }
    }
    getEcmeFieldData = (path, param) => {
        const {parentData,taskAddStore, taskAddStore:{cubeLayoutParame} } = this.props;
        const { specialFields } = cubeLayoutParame;
        const {params} = this.state;
        if (_.has(specialFields, path)) {
            let _isMandatory = param.isMandatory;
            if(_isMandatory){
                taskAddStore.isMandatoryArry.push(specialFields[path].fieldname);
            }
            // if (specialFields[path].fieldname == 'tag') {
            //     return <WeaBrowser onChange={(ids, names, datas) => { this.onChangeBrowser(ids, names, datas,"tag") }}
            //     type="wrltag" inputStyle={{ width: 245 }} viewAttr={_isMandatory?3:2}  isSingle={false} replaceDatas={params.tag} title={getLabel(30878,'任务标签')}/>
            // }
            if(specialFields[path].fieldname == 'showallsub'){
                return <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@q17q01`} value={params.showallsub} display="switch" viewAttr={_isMandatory?3:2} id="showallsub" style={{ display: 'inline' }} onChange={(v) => this.onInputChange(v, "showallsub")} />
            }
            if(specialFields[path].fieldname == 'parentid'){
                return <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@3vhtkx`} title={getLabel(23785,'上级任务')} type="wrltsk"
                onChange={(ids, names, datas) => { this.onChangeBrowser(ids, names, datas, "parentid") }}
                replaceDatas={parentData?parentData:params.parentid}
                hasAdvanceSerach={true}
                icon ="icon-coms-implement"
                iconBgcolor="rgb(150, 53, 138)"
                viewAttr={parentData?1:_isMandatory?3:2} 
                inputStyle={{ width: 245 }} dataParams ={{parentid:-1}} completeParams={{parentid:-1}}
                linkUrl="/spa/workrelate/static/index.html?#/main/workrelate/task/taskDetail?id="/>
            }
        }
        return null;
    }
    render() {
        let { params, sTab, urgent, viewHeight, category, menu,maxUploadSize,spinning,collectParams} = this.state;
        let { isDialog, createvisable, style, _minusHeight,parentData,taskAddStore } = this.props;
        if (_minusHeight == undefined) { _minusHeight = 0; }
        let{cubeLayoutParame,getCardStorefun} = taskAddStore;
        let cubeFlag = Object.keys(toJS(cubeLayoutParame)).length > 0;
        let content = <div className="wea-workrelate-task-add">
        <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@asqg1o`} spinning={spinning}>
           <WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@wdryt2`}/>
           <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@3mrc8l`} datas={menu} showUrlItem={false} style={{height:'100%'}} collectParams={collectParams}>
            {!isDialog && <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@tb356f`}
                    title={getLabel(15266,'新建任务')}
                    icon={<i className='icon-coms-implement'/>}
                    iconBgcolor='rgb(150, 53, 138)'
                    buttons = {[(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@a0th6h@save`} type="primary" onClick={this.doNewSave}>{getLabel(86,'保存')}</Button>)]}
                    showDropIcon={true}
                    dropMenuDatas={menu}
                    />}
            <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@6fr0wx`} height={viewHeight - _minusHeight} style={{ padding: '0 10px' }}>
            
            {cubeFlag? (CubeLayout({ cubeLayoutParame, "getEcmeFieldData": this.getEcmeFieldData,"callback":this.initCallBack, getCardStorefun })) :
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@0ilhsy`} title={getLabel(1361,'基本信息')} needTigger={true} showGroup={true}>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@n2022y`} label={getLabel(195,'名称')}
                    labelCol={{span: 4}}
                    wrapperCol={{span: 18}}>
                    <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@nphbyf`} placeholder={getLabel(508736,'请输入任务名称')} viewAttr={3} value={params.taskName} onBlur={(value) => this.onInputChange(value, "taskName")} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@mwqj9p`} label={getLabel(382534,'标记Todo')}
                    labelCol={{ span: 4 }}
                    wrapperCol={{ span: 18 }}>
                       <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@udlszv`} options={sTab} style={{width: 242}} value={params.todoval} onChange={(key) => this.onInputChange(key, "todoval")} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@qxdvn2`} label={getLabel(84043,'责任人')}
                    labelCol={{span: 4}}
                    wrapperCol={{span: 18}}>
                     <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@rpw0d9`} type={1}
                            replaceDatas={params.principalid}
                            inputStyle={{ width: 245 }}
                            title={getLabel(84043,'责任人')}
                            onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "principalid")}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@xo3nqs`}
                    label={getLabel(382557,'参与人')}
                    labelCol={{span: 4}}
                    wrapperCol={{span: 18}}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@liwse8`} type={17}
                                replaceDatas={params.partnerid}
                                inputStyle={{ width: 245 }}
                                title={getLabel(382557,'参与人')}
                                onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "partnerid")}
                                isSingle={false}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@i6g4l9`} label={getLabel(23785,'上级任务')}
                            labelCol={{ span: 4 }}
                            wrapperCol={{ span: 18 }}>
                            <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@jycqb1`}
                                onChange={(ids, names, datas) => { this.onChangeBrowser(ids, names, datas, "parentid") }}
                                replaceDatas={parentData?parentData:params.parentid}
                                title={getLabel(23785,'上级任务')}
                                icon ="icon-coms-implement"
                                iconBgcolor="rgb(150, 53, 138)"
                                type="wrltsk"
                                hasAdvanceSerach={true}
                                viewAttr={parentData?1:2}
                                inputStyle={{ width: 245 }}
                                dataParams ={{parentid:-1}}
                                completeParams={{parentid:-1}}
                                linkUrl="/spa/workrelate/static/index.html?#/main/workrelate/task/taskDetail?id="/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@lljygx`} label={getLabel(15534,'紧急程度')}
                            labelCol={{span: 4}}
                            wrapperCol={{span: 18}}>
                            <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@rz141w`} options={urgent} style={{width: 242,}} value={params.lev} onChange={(key) => this.onInputChange(key, "lev")} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@7oeqfj`} label={getLabel(741,'结束日期')}
                            labelCol={{span: 4}}
                            wrapperCol={{span: 18}}>
                            <WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@4m2f15`} value={params.enddate} onChange={value => this.onInputChange(value, "enddate")}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@k39sg3`} label={getLabel(433,'描述')}
                            labelCol={{span: 4}}
                            wrapperCol={{span: 18}}>
                        <WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@jpnovt`} value={params.remark} placeholder={getLabel(508733,'请输入任务描述')} onBlur={value => this.onInputChange(value,"remark")} />
                </WeaFormItem>
            </WeaSearchGroup>}
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@r1f0fa`} title={getLabel(22078,'相关信息')} needTigger={true} showGroup={true}>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@e07ppr`} label={getLabel(33414,'相关任务')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@cok8fa`} onChange={(ids, names, datas) => { this.onChangeBrowser(ids, names, datas, "taskids") }}
                            title={getLabel(33414,'相关任务')} icon ="icon-coms-currency-Task" type="wrltsk" replaceDatas = {params.taskids} viewAttr={2} isSingle={false} inputStyle={{ width: 245 }}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@q1k8bc`} label={getLabel(382586,'相关目标')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@6ushkx`} title={getLabel(382586,'相关目标')} icon ="icon-portal-ModelingEngine" type='wrlgoal' replaceDatas={params.goalids}
                            inputStyle={{ width: 245 }}
                            onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "goalids")} isSingle={false}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@n9v5fa`} label={getLabel(857,'相关文档')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@nmk4qp`} title={getLabel(857,'相关文档')} icon ="icon-portal-doc" type={9} inputStyle={{ width: 245 }} replaceDatas = {params.docids}
                            onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "docids")} isSingle={false} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@bmao3k`} label={getLabel(1044,'相关流程')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@ezc0ta`} title={getLabel(1044,'相关流程')} icon ="icon-coms-Workflow-o" type={16} inputStyle={{ width: 245 }} onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "wfids")}
                            isSingle={false} replaceDatas = {params.wfids}/>
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4298sz`} label={getLabel(783,'相关客户')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@vdji8q`} title={getLabel(783,'相关客户')} icon ="icon-portal-crm" type={7} inputStyle={{ width: 245 }} replaceDatas = {params.crmids}
                            onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "crmids")} isSingle={false} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@it3uab`} label={getLabel(782,'相关项目')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@x5pr7u`} title={getLabel(782,'相关项目')} icon ="icon-coms-project" type={8} inputStyle={{ width: 245 }} replaceDatas = {params.projectids}
                                onChange={(ids, names, datas) => this.onChangeBrowser(ids, names, datas, "projectids")} isSingle={false} />
                </WeaFormItem>
                <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@ozfmoz`} label={getLabel(22194,'相关附件')} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
                    <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@shhme8`} uploadUrl={'/api/doc/upload/uploadFile2Doc?category='+category} category={category}
                            viewAttr='1' showClearAll={false}  autoUpload={false} maxUploadSize={maxUploadSize} 
                            getShowListDatas={(listT, listB) => this.setUploading(listB)}
                            onChange={(ids, list) => this.uploadChange(ids, list)} ref={'addtaskupload'}
                            />
                </WeaFormItem>
            </WeaSearchGroup>
            </WeaNewScroll>
            </WeaRightMenu>
            </Spin></div>;
        return (
            isDialog ? <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2o1768`}
                visible={createvisable}
                title={getLabel(15266,'新建任务')}
                icon="icon-coms-implement"
                iconBgcolor="rgb(150, 53, 138)"
                className="createWorkPlan"
                buttons={this.getButton(this.props.ecId || '')}
                style={style}
                closable={true}
                onCancel={this.onlyClose}
            >
                {content}
            </WeaDialog> : content
        )
    }
};